﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace SlaktDataReader
{
    [Serializable]
    public class Location
    {
        private Guid ID;
        private Guid parentID;
        private string name;
        private string notes;
        private string code;
        private string secondCode;
        private int level;
        private string firstDate;
        private string lastDate;

        public Guid LocationID { get { return ID; } set { ID = value; IsChanged = true; } }
        public Guid ParentID { get { return parentID; } set { parentID = value; IsChanged = true; } }
        public string LocationName { get { return name; } set { this.name = value; IsChanged = true; } }
        public string LocationNotes { get { return notes; } set { notes = value; IsChanged = true; } }
        public string LocationCode { get { return code; } set { code = value; IsChanged = true; } }
        public string SecondaryCode { get { return secondCode; } set { secondCode = value; IsChanged = true; } }
        public int Level { get { return level; } set { level = value; IsChanged = true; } }
        public string FirstDate { get { return firstDate; } set { firstDate = value; IsChanged = true; } }
        public string LastDate { get { return lastDate; } set { lastDate = value; IsChanged = true; } }

        public Location()
        {
            this.ID = Guid.NewGuid();
        }

        [XmlIgnore]
        public bool IsChanged { get; set; }
    }
}
